package repositories;

import java.util.Collection;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import domain.User;

@Repository
public interface UserRepository extends JpaRepository<User,Integer>{
	
	// List the participants of a specific event
	@Query("select r.user from Registration r where r.project.id = ?1")
	Collection<User> findUserByProject(int projectId);
	
	
}
